#ifdef __cplusplus
extern "C" {
#endif

#ifndef __DEBUG_H__
#define __DEBUG_H__

#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <stdbool.h>

#define debug(X, ...) \
  DEBUGMSG((X),__FILE__,__LINE__,__FUNCTION__, __VA_ARGS__)
#define rawmsg(X, D, L, ...)						\
  RAWMSG((X),(L),(u_int8_t*)(D),__FILE__,__LINE__,__FUNCTION__, __VA_ARGS__)
#define hexmsg(X, D, L, ...)						\
  HEXMSG((X),(L),(u_int8_t*)(D),__FILE__,__LINE__,__FUNCTION__, __VA_ARGS__)
  
void RAWMSG (int debug, int len, u_int8_t * data, 
	     const char * file, int line, const char * func, char *fmt, ...);
void HEXMSG (int debug, int len, u_int8_t * data, 
	     const char * file, int line, const char * func, char *fmt, ...);
void DEBUGMSG (int debug, const char * file, int line, 
	       const char * func, const char *fmt, ...);

void enableDebugMsg ();
void disableDebugMsg ();
void debugMsgOutput (FILE * fs);
void debugPoint ();

#endif /* __DEBUG_H__ */

#ifdef __cplusplus
}
#endif

